package cn.wen.eeayjoke.presenter;

import cn.wen.core.utils.APPUtils;
import cn.wen.eeayjoke.entity.bean.base.ResponseBean;
import cn.wen.eeayjoke.entity.bean.home.HomeData;
import cn.wen.eeayjoke.entity.bean.home.More;
import cn.wen.eeayjoke.entity.bean.home.MoreBean;
import cn.wen.eeayjoke.entity.data.CommData;
import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * 首页数据请求接口
 */

public class HomePresenter extends BasePresenter {
    /**
     * 首页接口
     */
    public void index(Observer<HomeData> observer) {
        CommData data = new CommData();
        data.versionNumber = APPUtils.getVersionName();
        Observable<ResponseBean<HomeData>> observable = mApi.index(createRequestBody(data));
        convert(observable, observer);

    }

    /**
     * 首页接口
     */
    public void moreAlsoLike(String page, Observer<MoreBean> observer) {
        More data = new More(page);
        Observable<ResponseBean<MoreBean>> observable = mApi.moreAlsoLike(createRequestBody(data));
        convert(observable, observer);

    }
}
